#ifndef __EZFB_EZFB_H__
#define __EZFB_EZFB_H__

#define EXTERN				extern
#define STATIC				static
#define CONST				const
#define EZFBAPI
#define INLINE				EZFBAPI inline
#define SIZEOF(type)		sizeof(type)

typedef signed char			CHAR,	*LPCHAR,	STR,		*LPSTR;
typedef unsigned char		BYTE,	*LPBYTE;
typedef signed short		SHORT,	*LPSHORT;
typedef unsigned short		WORD,	*LPWORD;
typedef signed int			INT,	*LPINT;
typedef unsigned int		UINT,	*LPUINT,	BOOL,		*LPBOOL;
typedef signed long			LONG,	*LPLONG,	LRESULT,	*LPLRESULT;
typedef unsigned long		ULONG,	*LPULONG,	DWORD,		*LPDWORD,		COLORREF, *LPCOLORREF;
typedef void				VOID,	*LPVOID,				*HANDLE;

typedef struct tagFONT { DWORD dwUnused; }	*FONT;

typedef CONST CHAR			CCHAR,	*LPCSTR;
typedef CONST BYTE			CBYTE,	*LPCBYTE;

#define BPP_32				32
#define BPP_24				24
#define BPP_16				16
#define BPP_08				8
#define BPP_04				4
#define BPP_02				2
#define BPP_01				1

#ifndef BITS_PER_PIXEL
#define BITS_PER_PIXEL		BPP_16
#endif//BITS_PER_PIXEL

#if BITS_PER_PIXEL != BPP_32 && BITS_PER_PIXEL != BPP_24 && BITS_PER_PIXEL != BPP_16// && BITS_PER_PIXEL != BPP_08 && BITS_PER_PIXEL != BPP_04 && BITS_PER_PIXEL != BPP_02 && BITS_PER_PIXEL != BPP_01
#error Unsupport Bits Per Pixel Value.
#endif

#ifndef TRUE
#	define TRUE				0x00000001UL
#endif//TRUE
#ifndef FALSE
#	define FALSE			0x00000000UL
#endif//FALSE
#ifndef NULL
#	define NULL				0x00000000L
#endif//NULL
#ifndef S_OK
#	define S_OK				0x00000000L
#endif//S_OK
#ifndef MAX_PATH
#	define MAX_PATH			0x00000100L
#endif//MAX_PATH

#define MAX(a, b)		((a) > (b) ? (a) : (b))
#define MIN(a, b)		((a) < (b) ? (a) : (b))

#ifndef __cplusplus
#	define EZFBAPIBEGIN()
#	define EZFBAPIEND()
#else
#	define EZFBAPIBEGIN()	EXTERN "C" {
#	define EZFBAPIEND()		}
#endif//__cplusplus

#define DF_BUFFER		0x80000000
#define DF_SCREEN		0x00000000

EZFBAPIBEGIN()

BOOL		EZFBAPI		InitEzfbLibrary(
						);

VOID		EZFBAPI		FreeEzfbLibrary(
						);

VOID		EZFBAPI		Refresh(
						BOOL bDirection
						);

VOID		EZFBAPI		SetPixel(
						LONG x,
						LONG y,
						COLORREF crColor,
						DWORD dwFlag
						);

COLORREF	EZFBAPI		GetPixel(
						LONG x,
						LONG y,
						COLORREF crColor,
						DWORD dwFlag
						);

VOID		EZFBAPI		DrawLine(
						LONG x1,
						LONG y1,
						LONG x2,
						LONG y2,
						COLORREF crColor,
						DWORD dwFlag
						);

VOID		EZFBAPI		DrawRect(
						LONG left,
						LONG top,
						LONG right,
						LONG bottom,
						COLORREF crColor,
						DWORD dwFlag
						);

VOID		EZFBAPI		FillRect(
						LONG left,
						LONG top,
						LONG right,
						LONG bottom,
						COLORREF crColor,
						DWORD dwFlag
						);

BOOL		EZFBAPI		WriteBlock(
						LONG x,
						LONG y,
						LONG cx,
						LONG cy,
						LPVOID lpBits,
						DWORD dwFlag
						);

VOID		EZFBAPI		DrawCircle(
						LONG x0,
						LONG y0,
						LONG r,
						COLORREF crColor,
						DWORD dwFlag
						);

VOID		EZFBAPI		FillCircle(
						LONG x0,
						LONG y0,
						LONG r,
						COLORREF crColor,
						DWORD dwFlag
						);

FONT		EZFBAPI		LoadFontData(
						LPSTR lpszFilePath
						);

VOID		EZFBAPI		FreeFontData(
						FONT font
						);

VOID		EZFBAPI		TextOut(
						LONG x,
						LONG y,
						LPCSTR lpszText,
						LONG lnLength,
						FONT fntFont,
						COLORREF crColor,
						DWORD dwFlag
						);

EZFBAPIEND()

#endif//__EZFB_EZFB_H__
